﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;

namespace ERP.ERPSystem.ProductionSystem.Dto
{
    /// <summary>
    /// 车间的数据传输对象 (DTO)，用于在各层之间传递车间数据。
    /// </summary>
    public class WorkshopDTO : EntityDto<int>
    {
        /// <summary>
        /// 车间编码
        /// </summary>
        public string WorkshopCode { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string WorkshopName { get; set; }

        /// <summary>
        /// 车间面积
        /// </summary>
        public decimal? WorkshopSize { get; set; }

        /// <summary>
        /// 车间负责人
        /// </summary>
        public string WorkshopPerson { get; set; }

        /// <summary>
        /// 是否启用 (1=启用, 0=禁用)
        /// </summary>
        public int? IsNo { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        public string Context { get; set; }
    }
    
    /// <summary>
    /// 用于查询车间的输入DTO，包含筛选和分页信息。
    /// </summary>
    public class GetWorkshopInputDto : PagedAndSortedResultRequestDto
    {
        /// <summary>
        /// (筛选条件) 车间编码
        /// </summary>
        public string? WorkshopCode { get; set; }
        
        /// <summary>
        /// (筛选条件) 车间名称
        /// </summary>
        public string? WorkshopName { get; set; }
    }

    /// <summary>
    /// 用于创建或更新车间的DTO
    /// </summary>
    public class CreateUpdateWorkshopDto
    {
        /// <summary>
        /// 车间编码
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string WorkshopCode { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string WorkshopName { get; set; }
        
        /// <summary>
        /// 车间面积
        /// </summary>
        public decimal? WorkshopSize { get; set; }

        /// <summary>
        /// 车间负责人
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string WorkshopPerson { get; set; }
        
        /// <summary>
        /// 是否启用 (1=启用, 0=禁用)
        /// </summary>
        [Required(ErrorMessage = "必须选择是否启用")]
        public int? IsNo { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(50)]
        public string Context { get; set; }
    }
}
